package test;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;

import javax.swing.JFrame;
import javax.swing.JScrollPane;

import map.Map;
import map.MapData;
import map.MapDisplayPanel;
import map.MapLibrary;
import map.MapManipulationPanel;





public class MapTester
{
	public static void main(String args[])
	{
		MapLibrary toast = new MapLibrary("sand_dirt_library_dos\\", "settings.txt");
		MapData data = new MapData(10, 10);
		Map map = new Map(data, toast);
		MapDisplayPanel panel = new MapDisplayPanel(map);
		JScrollPane pane = new JScrollPane(panel);
		JFrame frame = new JFrame();
		frame.setBackground(Color.BLACK);
		Container framePane = frame.getContentPane();
		framePane.setLayout(new BorderLayout());
		framePane.add(pane, BorderLayout.CENTER);
		framePane.add(new MapManipulationPanel(panel), BorderLayout.SOUTH);
		frame.setSize(500,500);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		/*data.setTerrain(0, 0, 14, 1);
		data.setTerrain(11, 0, 14, 2);
		data.setTerrain(0, 11, 14, 0);
		data.setTerrain(11, 11, 14, 3);
		for(int i = 1; i < 11; i++)
		{
			data.setTerrain(0, i, 13, 1);
			data.setTerrain(i, 0, 13, 2);
			data.setTerrain(11, i, 13, 3);
			data.setTerrain(i, 11, 13, 0);
		}*/
		map.randomFill();
	}
}